﻿//----------------------------------------------------------------------
// <copyright file="CacheBaseMaServerInfo.cs" company="NTT DATA BEEN (China)">
// Copyright (c)2012 NTT DATA BEEN (China) Information Technology Co.,Ltd.
// </copyright>
// <author> lidawei </author>
// <summary>
// システム名称　　：
// モジュールＩＤ　：
// モジュール名称　：
// 機能概要　　　　：CacheBaseMaServerInfo类 
// 改訂履歴　　　　：
// 2012-08-01 新規 lidawei    Been0001   
// </summary>
//---------------------------------------------------------------------- 

namespace Ntt.NttData.Been.Management.SolutionA.Sync.Operator.BLL
{
    using System.Collections.Generic;

    public class CacheBaseMaServerInfo
    {
        private static  CacheBaseMaServerInfo _cache;
        private static readonly object LockHelper = new object();
        private List<Model.EntityBaseMaServerInfo> _cacheData ;
        private CacheBaseMaServerInfo() { }

        public static CacheBaseMaServerInfo GetInstance()
        {
            lock (LockHelper)
            {
                if (_cache == null) _cache = new CacheBaseMaServerInfo();
            }

            return _cache;
        }

        public List<Model.EntityBaseMaServerInfo>    BaseMaServerInfoList 
        { 
            get { return _cacheData ?? (_cacheData = SourceDAL.ManagementToolsDatabase.GetMaServerInfo()); }
        }

        public void InitData()
        {
            _cacheData = BaseMaServerInfoList;
        }

    }
}
